package com.gxa.modules.community.service.impl;



import com.gxa.modules.community.entity.Region;
import com.gxa.modules.community.entity.RegionManage;
import com.gxa.modules.community.mapper.RegionManageMapper;
import com.gxa.modules.community.service.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RegionServiceImpl implements RegionService {
    @Autowired
    private RegionManageMapper regionManageMapper;

    @Override
    public List<RegionManage> queryByPage(Map<String, Object> params) {
        String regionNameOrId = (String)params.get("regionNameOrId");
        String communityId = (String)params.get("communityId");
        System.out.println(regionNameOrId);
        System.out.println(communityId);
        List<RegionManage> regionManages=this.regionManageMapper.queryByPage(regionNameOrId,communityId);
        return regionManages;
    }
    @Override
    public List<Region> regiontypeList() {
        List<Region> regions =this.regionManageMapper.regiontypeList();
        return regions;
    }

    @Override
    public void regiontypeAdd(String regiontypeName) {
        this.regionManageMapper.regiontypeAdd(regiontypeName);
    }

    @Override
    public void regionAdd(RegionManage regionManage) {
        this.regionManageMapper.addRegion(regionManage);
    }

    @Override
    public void regionUpdate(RegionManage regionManage) {
        this.regionManageMapper.updateRegion(regionManage);
    }

    @Override
    public void regionDelete(Integer id) {
        this.regionManageMapper.deleteRegion(id);
    }

    @Override
    public void regionDeleteIds(List<Integer> ids) {
        this.regionManageMapper.regionDeleteIds(ids);
    }
}
